import java.util.HashMap;
import java.util.Map;

public class LQB_05 {
    public static void main(String[] args) {
        String s ="FFEEFEAAECFFBDBFBCDADACDEEDCCFFAFADEFBBAFDCDDCDBFEFCEDDBFDBEEFCAAEECEECDCDECADDCDFAEACECFEADCBFECADFDFBAAADCFAFFCEADFDDAEAFAFFDEFECEDEEEDFBDBFDDFFBCFACECEDCAFAFEFAFCDBDCCBCCEADADAEBAFBACACBFCBABFDAFBEFCFDCFBCEDCEAFBCDBDDBDEFCAAAACCFFCBBAAEECFEFCFDEEDCACDACECFFBAAAFACDBFFAEFFCCCDBFADDDBEBCBEEDDECFAFFCDEAFBCBBCBAEDFDBEBBBBABBFDECBCEFAABCBCFFBDBACCFFABEAEBEACBBDCBCCFADDCACFDEDECCCBFAFCBFECAACAFBCFBAF";
        fun(s);
        fun2(s);
        System.out.println();
    }
    static public void fun(String s) {
        int max = 0;
        Map<Character ,Integer> map = new HashMap<>();
        map.put('A',0);
        map.put('B',0);
        map.put('C',0);
        map.put('D',0);
        map.put('E',0);
        map.put('F',0);
        for (int i = 0; i < s.length(); i++) {
            Character character = s.charAt(i);
            map.put(character,map.get(character)+1);
        }
        System.out.println(map);
    }
    static public void fun2(String s) { // 散列表
        int[] a= new int[200];
        for (int i = 0; i < s.length(); i++) {
            a[0] = Math.max(++a[s.charAt(i)],a[0]);
        }
        System.out.println(a[0]);
    }
}
